<!-- 更新博客 -->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>
        back_blog - <%= title %>
    </title>
</head>
<link rel="shortcut icon" href="./images/favicon.ico">
<link rel="stylesheet" href="./bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="./stylesheets/public.css">
<link rel="stylesheet" href="./stylesheets/writeblog.css">

<body>
    <div class="blogwrap">
        <%- include head %>
            <div class="navbarconent col-md-12 col-sm-12 col-xs-12">
                <div class="boxContent">
                    <div class="navtitle clearfix">
                        <ol class="breadcrumb">
                            <li><a href="/">主页</a></li>
                            <li><a href="/manageblogs">博客管理</a></li>
                            <li>
                                <a href="/editblogs">
                                    <%= title %>
                                </a>
                            </li>
                        </ol>
                    </div>
                    <div class="writeblog">
                        <p class="title">更新博客</p>
                        <form role="form" class="form-horizontal" action="/editblogs"  enctype="multipart/form-data" method="post">
                            <input type="hidden" name="blogid" value="<%= editblog._id%>" id="blogid" />
                            <input type="hidden" name="blogpage" value="<%= page%>" id="blogpage" />
                            <div class="form-group">
                                <label class="col-md-2 col-sm-2">博客标题：</label>
                                <div class="col-md-10 col-sm-10">
                                    <input type="text" class="form-control" placeholder="请输入博客标题" id="title" name="title" value="<%= editblog.title%>">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 col-sm-2">博客作者：</label>
                                <div class="col-md-10 col-sm-10">
                                    <input type="text" placeholder="请输入作者名字" class="form-control" id="author" name="author" value="<%= editblog.author%>" disabled>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 col-sm-2">博客类别：</label>
                                <div class="col-md-10 col-sm-10">
                                    <input type="text" placeholder="请输入博客类别" class="form-control" id="category" name="category" value="<%= editblog.category%>" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 col-sm-2">博客原封面：</label>
                                <div class="col-md-10 col-sm-10">
                                    <input type="hidden" class="form-control" name="oldimg" id="oldimg" value="<%= editblog.cover%>">
                                    <img src="<%= editblog.cover%>" style="width: 120px;"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 col-sm-2">博客新封面：</label>
                                <div class="col-md-10 col-sm-10">
                                    <div class="filebox">
                                        <input type="file" accept="image/*" id='inputfile' name="classifyimg" />
                                        <img src="" id='willsetImg' style="width: 120px;"/>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <input type="hidden" class=" blogconent" value="<%= editblog.editorvalue%>" />
                                <label class="col-md-2 col-sm-2">博客内容：</label>
                                <div class="col-md-10 col-sm-10">
                                    <script id="editor" name="editorValue" type="text/plain" style="min-height: 300px;width: auto"></script>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 col-sm-2"></label>
                                <div class="col-md-10 col-sm-10">
                                    <button class="btn btn2 btn-primary" type="submit">保 存</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
    </div>

</body>
<script src="./javascripts/jquery.min.js"></script>
<script src="./bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" charset="utf-8" src="./ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="./ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="./ueditor/lang/zh-cn/zh-cn.js"></script>
<script src="./javascripts/sweetalert2@8.js"></script>
<script src="./javascripts/editblogs.js"></script>
<script type="text/javascript">
    var ue = UE.getEditor('editor');
    let cont = $('.blogconent').val()
    ue.ready(function() {
        ue.setContent(cont);
    });
</script>

</html>